home *** CD-ROM | disk | FTP | other *** search
/ CD Fun House 8 / CD Funhouse Version 8.0 - Wayzata Technology (7013) (1993).iso / pc / mac / __the_sc / mr._mo / background_2797.txt next >
Text File  |  1989-04-17  |  2KB  |  115 lines

  1. -- background: 2797 from stack: in._mo
  2. -- bmap block id: 0
  3. -- flags: 4000
  4. -- background id: 0
  5. -- name: 
  6. ----- HyperTalk script -----
  7. on getProb
  8.   global sel, skill, answer, n, snd1
  9.  
  10.  
  11.   if skill<4
  12.   then
  13.   if skill=1 then put 10 into t
  14.   if skill=2 then put 100 into t
  15.   if skill=2 and sel<>3 then put 10 into t
  16.   if skill=3 then put 1000 into t
  17.   put 2*t into bug
  18.   put the random of bug into a
  19.   put the random of bug into b
  20.   put a-t into a
  21.   put b-t into b
  22.   if a=0 then put 3 into a
  23.   if b=0 then put 2 into b
  24.   if skill=1 then
  25.     put abs(a) into a
  26.     put abs(b) into b
  27.     if b>a then
  28.       put a into temp
  29.       put b into a
  30.       put temp into b
  31.     end if
  32.   end if
  33. end if
  34. if skill>=4
  35. then
  36. if skill=4 then put 10000 into t else put 100000 into t
  37. put the random of t into a
  38. put the random of t into b
  39. put the random of 3 into c
  40. put a/(10^c) into a
  41. put b/(10^c) into b
  42. end if
  43.  
  44.  
  45. if sel=1
  46. then
  47. put a&" + "&b into card field 2
  48. put a+b into answer
  49. put "plus" into snd1
  50. end if
  51.  
  52. if sel=2
  53. then
  54. put a&" - "&b into card field 2
  55. put a-b into answer
  56. put "minus" into snd1
  57. end if
  58.  
  59. if sel=3
  60. then
  61. put a&" x "&b into card field 2
  62. put a*b into answer
  63. put "times" into snd1
  64. end if
  65. if sel=4
  66. then
  67. if a=0 then put 2 into a
  68. if b=0 then put 3 into b
  69. put a*b into c
  70. put c into a
  71. put a/b into answer
  72. put a&" √∑ "&b into card field 2
  73. put "divide" into snd1
  74. end if
  75.  
  76. sayProb
  77.  
  78. end getProb
  79.  
  80.  
  81. on sayProb
  82.   global snd1
  83.   repeat with x=1 to the number of chars in word 1 of card field 2
  84.     get char x of word 1 of card field 2
  85.     put it into y
  86.     if y=0 then play "10" f#3w
  87.     if y="." then play "point" f#3w
  88.     if y="-" then
  89.       play "negative"
  90.       wait 75 ticks
  91.     end if
  92.     play y f#3w
  93.   end repeat
  94.  
  95.   play snd1 f#3w
  96.   if snd1="divide" then wait 5 seconds -- has trouble with this one.
  97.  
  98.   repeat with x=1 to the number of chars in word 3 of card field 2
  99.     get char x of word 3 of card field 2
  100.     put it into y
  101.     if y=0 then play "10" f#3w
  102.     if y="." then play "point" f#3w
  103.     if y="-" then
  104.       play "negative"
  105.       wait 75 ticks
  106.     end if
  107.  
  108.     play y f#3w
  109.   end repeat
  110.   play "equals" f#3w
  111.   play "bell" f#3w
  112. end sayProb
  113.  
  114.  
  115.